
using Bee.Base.Abstractions.Tasks;
using Bee.Base.ViewModels;
using Bee.Plugin.Multimedia.Models;

using Ke.Bee.Localization.Localizer.Abstractions;

namespace Bee.Plugin.Multimedia.ViewModels;

public class AudioProcessViewModel : WorkspaceViewModel
{
    /// <summary>
    /// 输出格式集合
    /// </summary>
    public List<string> OutputFormats => [.. MultimediaProcessConsts.AvailableAudioFormats];
    /// <summary>
    /// 比特率(音频质量)
    /// </summary>
    public List<int> AudioQualities => [384, 320, 256, 192, 128, 96, 64];
    /// <summary>
    /// 采样率
    /// </summary>
    public List<int> AudioSamplingRates => [192000, 96000, 48000, 44100, 24000, 22050, 16000];
    /// <summary>
    /// 音频通道
    /// </summary>
    public List<int> AudioChannels => [1, 2, 6, 8];
    /// <summary>
    /// 音频编码器
    /// </summary>
    public List<string> AudioCodecs => [.. MultimediaProcessConsts.AvailableAudioCodecs.Select(x => $"{x.Name}({x.Value})")];
    /// <summary>
    /// 任务列表控件视图模型
    /// </summary>
    public ITaskListViewModel<AudioProcessArguments> TaskList { get; }

    public AudioProcessViewModel(IServiceProvider serviceProvider, ILocalizer l, TaskListViewModel<AudioProcessArguments> taskList) : base(serviceProvider, l)
    {
        IsPaneOpen = true;
        TaskList = taskList;
        TaskList.InitialArguments(MultimediaProcessConsts.PluginName);
        TaskList.SetInputExtensions(MultimediaProcessConsts.AvailableFormats);
    }
}